import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'plate_lpr_platform_interface.dart';

/// An implementation of [PlateLprPlatform] that uses method channels.
class MethodChannelPlateLpr extends PlateLprPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('com.yunkai.plate_lpr');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  Future<String?> recog({EOpenType openType = EOpenType.NoPlate}) async {
    final plate = await methodChannel.invokeMethod<String>('recog', {"type": openType.value});
    return plate;
  }

  void deletePic() async {
    await methodChannel.invokeMethod<String>('deletePic');
  }
}

